function BeTime(year) { return new Date(year + '/06/07 00:00:00'); }
function calculate() {
    let NowTime = new Date();
    let year = NowTime.getFullYear();
    let EndTime = BeTime(year);
    if (EndTime - NowTime < 0) EndTime = BeTime(++year);
    let dif = EndTime - NowTime;
    document.getElementById("year").innerHTML = year;
    document.getElementById("day").innerHTML = Math.floor(dif / 1000 / 60 / 60 / 24);
    document.getElementById("hour").innerHTML = Math.floor(dif / 1000 / 60 / 60 % 24);
    document.getElementById("minute").innerHTML = Math.floor(dif / 1000 / 60 % 60);
    document.getElementById("second").innerHTML = Math.floor(dif / 1000 % 60);
    return calculate;
}
let id = setInterval(calculate(), 1000);
let btn = document.getElementById("btn");
let flag = true;
btn.addEventListener("click", () => {
    if (flag) {
        clearInterval(id);
        btn.innerHTML = "Continue";
        flag = false;
    } else {
        id = setInterval(calculate(), 1000);
        btn.innerHTML = "Stop";
        flag = true;
    }
})